/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

requirejs(['jquery', 'util', 'fancyBox', 'datatables', 'ztree', 'ztree_loader'], function($, util, fancyBox, dataTables, ztree, treeLoader) {
    $(function() {
        $('.dTable').dataTable(DataTableConfig);
        $('.pd-del-btn').click(function() {
            if (confirm('你确定要删除这个产品吗')) {
                $.post(shoproot + '?/WdminAjax/deleteProduct/', {
                    id: parseInt($(this).attr('data-product-id'))
                }, function(res) {
                    if (parseInt(res) > 0) {
                        alert('删除成功');
                        location.reload();
                    } else {
                        alert('删除失败');
                    }
                });
            }
        });
    });
});